<?php

require  './vendor/autoload.php';

$client = new MongoDB\Client('mongodb://192.168.1.25:27017');
$database = $client->selectDatabase('ticket');
$col = $database->selectCollection('tk_ticket_report_evaluate');

$match['$match'] = array(
    'vcc_id' => (int) 3,
    'date' => array('$gte' => '2017-08-01', '$lte' => '2017-08-30'),
);
$sort['$sort'] = array(
    'date' => 1
);
$group['$group'] = array(
    '_id' => '$date',
    'end_eva_num' => array(
        '$sum' => '$非凡哥_2',
    ),
);
$condition[] = $match;;
$condition[] = $group;
$condition[] = $sort;
$data = $col->aggregate($condition);
print_r($data);
exit;

